
from PyQt4.QtGui import QMessageBox, QInputDialog, QLineEdit


class MessageBox(object):

    @staticmethod
    def info(title, message):
        QMessageBox(QMessageBox.Information, title, message, QMessageBox.Yes).exec_()

    @staticmethod
    def confirm(parent, title, message):
        return QMessageBox.question(parent, title, message, QMessageBox.Yes | QMessageBox.No, QMessageBox.No)


class Dialog(object):

    @staticmethod
    def input_int(parent, title, message, value=0, min=-2147483647, max=2147483647, step=1):
        return QInputDialog.getInt(parent, title, message, value, min, max, step)

    @staticmethod
    def input_text(parent, title, message, mode=QLineEdit.Normal):
        return QInputDialog.getText(parent, title, message, mode)